<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="shortcut icon" href="/static/img/favicon.png">

  <title>{{.title}}</title>

  <!-- Bootstrap core CSS -->
  <link href="/static/css/bootstrap.css" rel="stylesheet">
  <!-- <link href="/static/css/bootstrap-theme.min.css" rel="stylesheet"/>
  -->
  <link href="/static/css/custom.css" rel="stylesheet"/>
  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
  <!--[if lt IE 9]>
  <script src="../../assets/js/html5shiv.js"></script>
  <script src="../../assets/js/respond.min.js"></script>
  <![endif]-->
  <!--favicon-->
  <link rel="shortcut icon" href="/static/img/gopher.jpg"/>
  <script src="/static/js/jQuery1.10.2.js"></script>
</head>
<body>
  <div class="header-wrapper">
    <div class="container">
      <div class="navbar navbar-inverse" >
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="/">42's Station</a>
        </div>
        <div class="collapse navbar-collapse">
          <p class="navbar-text" style="color:#FFF;text-align:center;font-weight:700;">Answer to the Ultimate Question of Everything.</p>
          <ul class="nav navbar-nav" style="float:right">
            <li class="dropdown">
              <a class="dropdown-toggle" data-toggle="dropdown">
                博客地图 <b class="caret"></b>
              </a>
              <ul class="dropdown-menu">
                <li>
                  <a href="/">首页</a>
                </li>
                <li>
                  <a href="/article">文章</a>
                </li>
                <li>
                  <a href="/image">照片</a>
                </li>
                <li class="divider"></li>
                <li>
                  {{if .logined}}
                  <a href="/exit">管理员退出</a>
                  {{else}}
                  <a data-toggle="modal" data-target="#login">管理员登录</a>
                  {{end}}
                </li>
              </ul>
            </li>
            <li {{if (compare .pos "about")}} class="active"{{end}}>
              <a href="/about">关于</a>
            </li>
          </ul>

        </div>
      </div>
    </div>
  </div>
  {{.LayoutContent}}
  <div class="footer-wrapper">
    <script src="/static/js/bootstrap.js"></script>
    <ul class="pager">
  <li><a style="color:#000"><span class="glyphicon glyphicon-eye-open"> 今日访问量: {{.viewtoday}} 总共: {{.viewall}}</span></a></li>

</ul>
    

  </div>

  <div class="modal-collection">
    <!-- Modal -->
    <!--login-->
    <div class="modal fade" id="login" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">登录</h4>
          </div>
          <form action="/" method="post">
            <div class="modal-body">
              <div class="input-group">
                <span class="input-group-addon">
                  <span class="glyphicon glyphicon-user"></span>
                </span>
                <input name="passwd" type="password" class="form-control" placeholder="口令" required="required"/>
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
              <button type="submit" class="btn btn-success">登录</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    {{if .logined}}
    <!-- Modal -->
    <!--addArticle-->
    <div class="modal fade" id="add_article" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">添加文章</h4>
          </div>
          <form action="/article/add" method="post">
           
            <div class="modal-body">

              <div class="input-group" style="margin-bottom:10px">
                <span class="input-group-addon">
                  <span class="glyphicon glyphicon-align-justify"></span>
                </span>
                <input name="title" type="text" class="form-control" placeholder="标题"/>
              </div>

              <textarea class="form-control" rows="15" name="content" placeholder="把文章写这里来"></textarea>

              <div class="input-group" style="margin-top:10px">
                <span class="input-group-addon">
                  <span class="glyphicon glyphicon-tag"></span>
                </span>
                <input name="tags" type="text" class="form-control" placeholder="标签 用空格分隔"/>
              </div>

              <div class="input-group" style="margin-top:10px">
                <span class="input-group-addon">
                  <span class="glyphicon glyphicon-inbox"></span>
                </span>
                <input name="categories" type="text" class="form-control" placeholder="分类"/>
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
              <button type="submit" class="btn btn-primary">发布</button>
            </div>
          </form>
        </div>
      </div>
    </div>
<!--add tsukkomi-->
    <div class="modal fade" id="add_tsukkomi" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">添加吐槽</h4>
          </div>
          <form action="/tsukkomi/add" method="post">
            <div class="modal-body">

              <textarea class="form-control" rows="15" name="content" placeholder="吐槽到这里来"></textarea>

            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
              <button type="submit" class="btn btn-primary">发布</button>
            </div>
          </form>
        </div>
      </div>
    </div>
    {{end}}
    {{if .logined}}
    <!-- Modal -->
    <!--del article-->
    <div class="modal fade" id="delete_article" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header alert alert-danger" style="margin-bottom:0">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">你确定要删除{{.Article.Name}}吗？</h4>
          </div>
          <div class="modal-footer alert alert-danger" style="margin-top:0;margin-bottom:0">
            <form action="/article/{{.Article.Id}}/del" method="post">
              <button type="button" class="btn btn-success" data-dismiss="modal">取消</button>
              <button type="submit" class="btn btn-danger">删了他！</button>
            </form>
          </div>
        </div>
      </div>
    </div>

    <div class="modal fade" id="edit_article" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">修改文章</h4>
          </div>
          <form action="/article/{{.Article.Id}}/edit" method="post">
            <div class="modal-body">

              <div class="input-group" style="margin-bottom:10px">
                <span class="input-group-addon glyphicon glyphicon-align-justify"></span>
                <input name="title" type="text" class="form-control" placeholder="标题" value="{{.Article.Name}}"/>
              </div>

              <textarea class="form-control" rows="15" name="content" placeholder="把文章写这里来" >{{.Article.Content}}</textarea>

              <div class="input-group" style="margin-top:10px">
                <span class="input-group-addon">
                  <span class="glyphicon glyphicon-tag"></span>
                </span>

                <input name="tags" type="text" class="form-control" placeholder="标签 用空格分隔" value="{{range .Article.Tags}}{{.}} {{end}}"/>
              </div>

              <div class="input-group" style="margin-top:10px">
                <span class="input-group-addon">
                  <span class="glyphicon glyphicon-inbox"></span>
                </span>
                <input name="categories" type="text" class="form-control" placeholder="分类" value="{{range .Article.Categories}}{{.}} {{end}}"/>
              </div>
            </div>
            <div class="modal-footer">
              <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
              <button type="submit" class="btn btn-primary">修改</button>
            </div>
          </form>
        </div>
      </div>
    </div>

    

    <div class="modal fade" id="delete_tsukkomi" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header alert alert-danger" style="margin-bottom:0">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="myModalLabel">你确定要删除此吐槽吗？</h4>
          </div>
          <div class="modal-footer alert alert-danger" style="margin-top:0;margin-bottom:0">
            <form action="/tsukkomi//del" method="post">
              <button type="button" class="btn btn-success" data-dismiss="modal">算了不删了</button>
              <button type="submit" class="btn btn-danger">删了他！</button>
            </form>
          </div>
        </div>
      </div>
    </div>
    {{end}}
  </div>
</body>
</html>